function [XD,YD]=p_ellipse(rx,ry)
% p_ellipse: Return vertices of an ellipse
%
% SYNTAX:
%   [XD,YD] = p_ellipse(rx,ry)
%   [XY] = p_ellipse(rx,ry)
%   Return vertices of an ellipse with x-radius rx and y-radius ry

%   Author: Hongbin Ma
%   Last updated: 2009-6-2 with MATLAB 6.5
%   Problems or suggestions? Email me: mathmhb[at]163.com

w=[-pi:pi/30:pi];
XD=rx*cos(w);
YD=ry*sin(w);
if nargout<2,
    XD=[XD;YD]';
end;